int pairSum(ListNode* head) {
        ListNode *slow = head, *fast = head->next;

        while(fast->next)
        {
            slow = slow->next;
            fast = fast->next->next;
        }
        // 反转链表
        ListNode *last = slow->next;
        while(last->next)
        {
            ListNode *cur = last->next;
            last->next = cur->next;
            cur->next = slow->next;
            slow->next = cur;
        }

        int ans = 0;
        ListNode *x = head, *y = slow->next;
        while(y)
        {
            ans = max(ans, x->val + y->val);
            x = x->next;
            y = y->next;
        }
        return ans;
    }